package com.view
{
	public class FilterSelector
	{
		private var _filterField:String;
		private var _filterTypes:Array;
		
		public function FilterSelector(){ /**/ }
		
		public function get filterField():String
		{
			return _filterField;
		}
		
		public function set filterField(value:String):void
		{
			_filterField = value;
		}
		
		public function addFilterTypes(params:Array):void
		{
			_filterTypes = params;
		}
		
		public function generateFilterFunction():Function
		{
			var f:Function = function(item:Object):Boolean
							{ 
								for each(var type:String in _filterTypes)
								{
									if(item[filterField] == type) return true;
								}
								return false;
							};
			return f;
		}
	}
}